home *** CD-ROM | disk | FTP | other *** search
/ Scene Storm / Scene Storm - Volume 1.iso / coding / asm / utils / movevbr / vbr_fast.asm < prev    next >
Encoding:
Assembly Source File  |  1980-01-04  |  1.4 KB  |  73 lines

  1. _LVOSupervisor    =    -$1E
  2. _LVOForbid    =    -$84
  3. _LVOCacheClearU    =    -$27C
  4. _LVOFreeMem    =    -$D2
  5. _LVOPermit    =    -$8A
  6. _LVOTypeOfMem    =    -$216
  7. _LVOAllocMem    =    -$C6
  8. _LVOCopyMem    =    -$270
  9.  
  10. AbsExecBase    =    $4
  11. AttnFlags    =    $128
  12. MEMF_PUBLIC    =    $1
  13. MEMF_FAST    =    $4
  14.  
  15.         section    vbr_chip,code
  16.  
  17. Test:        **moveq    #1,d7            * relocate VBR to CHIP..
  18.         **moveq    #0,d7            * Get addr of VBR.. no reloc
  19.         moveq    #-1,d7            * relocate VBR to FAST..
  20.  
  21. ModifyVBR:    move.l    (AbsExecBase).w,a6
  22.         jsr    _LVOForbid(a6)
  23.         moveq    #0,d5
  24.         move.b    AttnFlags+1(a6),d0    * which processor is installed?
  25.         moveq    #3,d1
  26. .nextbit:    lsr.b    #1,d0
  27.         bcc.s    .not_060
  28.         add.w    #10,d5
  29.         dbf    d1,.nextbit
  30.         tst.b    AttnFlags+1(a6)     * 68060?
  31.         bpl.s    .not_060
  32.         add.w    #20,d5
  33. .not_060:    tst.b    d5
  34.         beq.s    Skip
  35.         lea    SetVBR(pc),a5
  36.         jsr    _LVOSupervisor(a6)
  37.         tst.b    d7
  38.         beq.b    Skip
  39.         bmi.b    VBR_To_Fast
  40.         move.l    a2,d0
  41.         tst.l    d0
  42.         beq.b    Skip
  43.         moveq    #0,d0
  44.         bra.b    RelocateVBR
  45. VBR_To_Fast    move.l    a2,a1
  46.         jsr    _LVOTypeOfMem(a6)
  47.         btst    #2,d0
  48.         bne.b    Skip
  49.         move.l    #1024,d0
  50.         moveq    #(MEMF_PUBLIC+MEMF_FAST),d1
  51.         jsr    _LVOAllocMem(a6)
  52.         tst.l    d0
  53.         beq.b    Skip
  54. RelocateVBR    move.l    d0,a3
  55.         move.l    a2,a0
  56.         move.l    d0,a1
  57.         move.l    #1024,d0
  58.         jsr    _LVOCopyMem(a6)
  59.         move.l    a2,-(sp)
  60.         move.l    a3,a2
  61.         lea    GetVBR(pc),a5
  62.         jsr    _LVOSupervisor(a6)
  63.         jsr    _LVOCacheClearU(a6)
  64.         move.l    (sp)+,d0
  65.         beq.b    Skip
  66.         move.l    d0,a1
  67.         move.l    #1024,d0
  68.         jsr    _LVOFreeMem(a6)
  69. Skip        jmp    _LVOPermit(a6)
  70. SetVBR        movec    vbr,a2
  71. GetVBR        movec    a2,vbr
  72.         rte
  73.